//
//  JSVMManager.m
//  VirtualView
//
//  Created by xiaerfei on 2019/8/10.
//

#import "JSVMManager.h"

@interface JSVMManager()

@property (nonatomic, strong) JSVirtualMachine *vm;

@end

@implementation JSVMManager

+ (instancetype)manager {
    static JSVMManager *manager = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [[JSVMManager alloc] init];
    });
    return manager;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.vm = [[JSVirtualMachine alloc] init];
    }
    return self;
}

- (JSContext *)createContext {
    JSContext *context = [[JSContext alloc] initWithVirtualMachine:self.vm];
    return context;
}




@end
